package com.yserp.project.erp.bill.payment.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yserp.common.utils.mybatis.MybatisPlusUtil;
import com.yserp.project.erp.bill.payment.domain.PaymentItem;
import com.yserp.project.erp.bill.payment.mapper.PaymentItemMapper;
import com.yserp.project.erp.bill.payment.service.IPaymentItemService;
import com.yserp.project.erp.order.purchorder.service.IPurchOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 商品入库单子Service业务层处理
 * 
 * @author yserp
 * @date 2022-08-08
 */
@Service
public class PaymentItemServiceImpl extends ServiceImpl<PaymentItemMapper, PaymentItem> implements IPaymentItemService
{
    @Resource
    private PaymentItemMapper paymentItemMapper;
    @Autowired
    private IPurchOrderService purchOrderService;


    /**
     * 查询商品入库单子列表
     * 
     * @param paymentItem 商品入库单子
     * @return 商品入库单子
     */
    @Override
    public List<PaymentItem> selectPaymentItemList(PaymentItem paymentItem)
    {
        QueryWrapper<PaymentItem> queryWrapper = new QueryWrapper<>();
        MybatisPlusUtil.notNullField(paymentItem, queryWrapper);
        return paymentItemMapper.selectList(queryWrapper);
    }

    @Override
    public List<PaymentItem> selectPaymentItemListByMainId(Long mainId) {
        PaymentItem paymentItem = new PaymentItem();
        paymentItem.setMainId(mainId);
        return this.selectPaymentItemList(paymentItem);
    }



}
